﻿using System.Collections.ObjectModel;

namespace BingleMaps.Models
{
    public class UserPinCollection : ObservableCollection<UserPinEx>
    {
        //public UserPinEx GetLocationalDuplicatePin(UserPinEx pin)
        //{
        //    return Items.FirstOrDefault(p => p.LocationEquals(pin));
        //}

        //public void Add(UserPinEx pin, UserPinEx.ChangeAction change = UserPinEx.ChangeAction.Add)
        //{
        //    pin.Change = change;
        //    base.Add(pin);
        //}

        //public void Remove(UserPinEx pin, bool ignoreChange = false)
        //{

        //}

        //public void RemoveCheckedPins()
        //{
        //    foreach (var pin in Items.Where(p => p.IsChecked)) pin.Change = UserPinEx.ChangeAction.Delete;
        //}

        //public void Merge(UserPin oldPin, UserPin newPin)
        //{
        //    for (int i = Count - 1; i >= 0; i--)
        //        if (Items[i].Key == oldPin.Key)
        //        {
        //            RemoveAt(i);
        //            Insert(i, newPin);
        //            return;
        //        }
        //}
    }
}
